﻿/*----------------------------------------------------------------
// Copyright (C) 2011 苏富特健康科技
// 版权所有。 
//
// 文件名：PasswordVM.cs
// 文件功能描述：修改密码视图实体
//
// 
// 创建标识：2012-07-09 张强
//
// 变更标识：｛日期｝ ｛变更人｝
// 变更描述：｛变更详情｝
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace WebPlatform.Models
{

    /// <summary>
    /// 修改密码视图实体
    /// </summary>
    public class PasswordVM
    {
        /// <summary>
        /// 旧密码
        /// </summary>
        [Display(Name = "旧密码")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "旧密码 必填")]
        [RegularExpression("^[a-z0-9_-]{6,16}$", ErrorMessage = "旧密码6~16个字符")]
        [Remote("IsTruePassword", "Home", HttpMethod = "POST", ErrorMessage = "旧密码不正确")]
        public string OldPassword { get; set; }

        /// <summary>
        /// 新密码
        /// </summary>
        [Display(Name = "新密码")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "新密码 必填")]
        [RegularExpression("^[a-z0-9_-]{6,16}$", ErrorMessage = "新密码6~16个字符")]
        public string NewPassword { get; set; }
        
        
        /// <summary>
        /// 确认密码
        /// </summary>
        [Display(Name = "确认密码")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "确认密码 必填")]
        [RegularExpression("^[a-z0-9_-]{6,16}$", ErrorMessage = "确认密码6~16个字符")]
        [Remote("IsSamePassword", "Home", AdditionalFields="NewPassword", HttpMethod = "POST", ErrorMessage = "确认密码不一致")]
        public string ConfirmPassword { get; set; }
    }
}